<?php

// 控制基类
class Controller extends Smarty
{
    public function __construct()
    {
        // 初始化配置
        $this->setTemplateDir('./views')
            ->setCompileDir('./runtime/views_c')
            ->setConfigDir('./configs')
            ->setCacheDir('./runtime/caches');
        // 配置模板变量的定界符
        $this->left_delimiter = '<{';
        $this->right_delimiter = '}>';
        // 配置缓存控制
        $this->caching = false;
        $this->cache_lifetime = 30;
    }
    // 当调用不存在方法时
    public function __call($fun,$params)
    {
        header("HTTP/1.0 404NOT FOUND");
        echo '<h1>控制器404 NOT FOUND</h1>';
        exit;

    }
}